/*
 * Copyright 2025 The JA-SIG Collaborative. All rights reserved.
 * distributed with this file and available online at
 */
package com.lap.auth.application.user.command;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

import jakarta.validation.constraints.Size;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

@Data
@Schema(description = "创建管理员命令")
public class CreateUserCmd {

  @NotBlank(message = "{user.username.required}")
  @Length(max = 32, message = "{user.username.max.length}")
  @Schema(description = "用户名")
  private String username;

  @NotBlank(message = "{user.password.required}")
  @Length(max = 64, message = "{user.password.max.length}")
  @Schema(description = "密码")
  private String password;

  @NotBlank(message = "{user.fullName.required}")
  @Length(max = 16, message = "{user.fullName.max.length}")
  @Schema(description = "姓名")
  private String fullName;

  @NotBlank(message = "{user.email.required}")
  @Length(max = 64, message = "{user.email.max.length}")
  @Schema(description = "邮箱")
  private String email;

  @Size(max = 256, message = "{user.orgPath.max.length}")
  @Schema(description = "部门路径")
  private List<Integer> orgPaths;

  @Range(min = 0, max = 2147483647, message = "{user.jobId.range}")
  @Schema(description = "岗位ID")
  private Integer jobId;

  @NotNull(message = "{user.status.required}")
  @Range(min = -127, max = 128, message = "{user.status.range}")
  @Schema(description = "状态:0-禁用,1-启用")
  private Integer status;

  @Length(max = 128, message = "{user.remark.max.length}")
  @Schema(description = "状态描述")
  private String remark;

  @Schema(description = "有效期,格式:yyyy-MM-dd")
  private LocalDate termValidity;

  @NotNull(message = "{user.version.required}")
  @Range(min = 0, max = 2147483647, message = "{user.version.range}")
  @Schema(description = "版本")
  private Integer version;
}
